use thiserror::Error;

pub type Result<T> = std::result::Result<T, FluvioXError>;

#[derive(Error, Debug)]
pub enum FluvioXError {
    #[error("Database error: {0}")]
    Database(#[from] sqlx::Error),
    
    #[error("Serialization error: {0}")]
    Serialization(#[from] serde_json::Error),
    
    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),

    #[error("HTTP error: {0}")]
    Http(String),
    
    #[error("Fluvio error: {0}")]
    Fluvio(String),
    
    #[error("Configuration error: {0}")]
    Config(String),
    
    #[error("Connector error: {0}")]
    Connector(String),
    
    #[error("Validation error: {0}")]
    Validation(String),
    
    #[error("Not found: {0}")]
    NotFound(String),
    
    #[error("Internal error: {0}")]
    Internal(String),
}
